<!--
 * @Author: your name
 * @Date: 2021-03-06 17:30:16
 * @LastEditTime: 2021-08-27 00:00:39
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \background-front\src\store\global.vue
-->
<template></template>
<script type="text/javascript">
import axios from "@/api/ajax";
import Message from "element-ui/lib/message";

export default {
  planTypes:[],
  ws:{},
  Set_plan_type(planType){
    this.planTypes = planType
  },
  SetWebsocket(ws){
    this.ws = ws
  },
  mounted() {
    axios.get('/plan_types').then(response => {
      if (response.data.Status === 0) {
        for(let i = 0;i < response.data.Data.length; i ++){
          this.planTypes.push({
            value: response.data.Data[i].id,
            label: response.data.Data[i].type_name
          })
        }
      }
    }).catch(reason => {
      Message.error("网络错误:" + reason);
    });
  },
}
</script>
